<!DOCTYPE html>
<html lang="cn">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>PMS-business</title>
		<meta name="description" content="overview &amp; stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
	</head>
    <style>
        input{
            border: 1px solid #D5D5D5;
        }
    </style>
    <body>
        <div class="row" id="customBox" style="margin-bottom: -24px;position: relative;">

        </div>
        <script type="text/javascript"> 
            var ins_argjson={};
            $(".page-content-area").ace_ajax("loadScripts", new Array(), function() {
                $("#customBox").height($(window).height()-150)

                $.custom().then(({custom,C_DataSource,C_Where,C_Grid})=>{
                    var ScreenData = C_DataSource.ScreenBizData;

                    var s_width = ScreenData.screen[0]['width']!=""?ScreenData.screen[0]['width']:$(window).width()
                    var s_height = ScreenData.screen[0]['height']!=""?ScreenData.screen[0]['height']:$(window).height()
                    $.HSAPI_SETMODALSIZE(parseInt(s_width),parseInt(s_height),true)
                    
                    var text = ScreenData.screen[0]['title']||'自定义页面'
                    $("title").text(text)

                    var param = {}
                    param.boxId = "#customBox"
                    custom.init(ScreenData,param,function(){
                        
                    })
                }).then(()=>{
                    let dom = document.getElementById('customBox');
                    let data = dom.innerHTML;
                    let name = 'custom_test.html';

                    let customHtml = customHtmlBuild(data);

                    electron.ipcRenderer.send("asynchronous-message",customHtml ,name);

                    electron.ipcRenderer.on("asynchronous-reply", function(event, arg ,arg1) {
                        // 这里的arg是从主线程请求的数据
                        console.log("render+" + arg); 
                        // debugger
                        // window.open("#/html/custom/"+arg1,"_self")
                    });

                })
                
            });
        </script>
	</body>
</html>